package edu.kit.csl.cratylus.extraction;

import java.util.List;

import edu.kit.csl.cratylus.datatypes.Candidate;
import edu.kit.csl.cratylus.datatypes.Word;

/**
 * The corpus updater writes back the representative found by the merger back
 * to the corpus. Therefore, it incrementally builds the parallel corpus on 
 * word level, which is then written to the file system. The corpus updater 
 * belongs among the planner, splitter, and merger to the major logical modules
 * of cratylus.<br>
 * By contract, corpus updater do not get empty candidate groups or null words,
 * and they do not write empty words back to the corpus
 */
public interface CorpusUpdater {

	/**
	 * Replace the target word on all positions in the corpus specified by
	 * <code>candidates</code> with the word <code>word</code>.
	 * 
	 * @param word the replacement word
	 * @param candidates corpus positions of target words to replace
	 */
	void updateCorpus(Word word, List<Candidate> candidates);
}
